package com.yykj.user.center.server.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yykj.common.util.serializer.LocalDate2LongSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.time.LocalDateTime;

/**
 * @author chenl
 * @version 1.0
 * @date 2021/11/5 20:58
 */
@Data
@Entity
public class Address {

    @Id
    @Column(length = 50)
    private String id;

    @ApiModelProperty("就诊卡绑定的账户ID")
    private String accountId;

    @ApiModelProperty("就诊卡号ID")
    private String patientCardId;

    private String patientName;

    @ApiModelProperty("收件人姓名")
    private String recipientName;

    @Column(length = 500)
    private String detailAddress;

    private String mobile;

    private Boolean isDefault;

    private String area;

    @ApiModelProperty("创建时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    @CreationTimestamp
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @JsonSerialize(using = LocalDate2LongSerializer.class)
    @UpdateTimestamp
    private LocalDateTime updateTime;

    @ApiModelProperty("状态 1有效 0无效")
    private Boolean state=true;

}
